package com.qiuyuliantu.base.service.impl;

import java.util.List;
import com.qiuyuliantu.common.utils.DateUtils;
import com.qiuyuliantu.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.qiuyuliantu.base.mapper.QiuUserInfoMapper;
import com.qiuyuliantu.base.domain.QiuUserInfo;
import com.qiuyuliantu.base.service.IQiuUserInfoService;

/**
 * 存储情侣的亲人信息Service业务层处理
 *
 * @author ruoyi
 * @date 2025-04-02
 */
@Service
public class QiuUserInfoServiceImpl implements IQiuUserInfoService
{
    @Autowired
    private QiuUserInfoMapper qiuUserInfoMapper;

    /**
     * 查询存储情侣的亲人信息
     *
     * @param id 存储情侣的亲人信息主键
     * @return 存储情侣的亲人信息
     */
    @Override
    public QiuUserInfo selectSysUserInfoById(Long id)
    {
        return qiuUserInfoMapper.selectSysUserInfoById(id);
    }

    /**
     * 查询存储情侣的亲人信息列表
     *
     * @param qiuUserInfo 存储情侣的亲人信息
     * @return 存储情侣的亲人信息
     */
    @Override
    public List<QiuUserInfo> selectSysUserInfoList(QiuUserInfo qiuUserInfo)
    {
        return qiuUserInfoMapper.selectSysUserInfoList(qiuUserInfo);
    }

    /**
     * 新增存储情侣的亲人信息
     *
     * @param qiuUserInfo 存储情侣的亲人信息
     * @return 结果
     */
    @Override
    public int insertSysUserInfo(QiuUserInfo qiuUserInfo)
    {
        qiuUserInfo.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
        qiuUserInfo.setCreateTime(DateUtils.getNowDate());
        return qiuUserInfoMapper.insertSysUserInfo(qiuUserInfo);
    }

    /**
     * 修改存储情侣的亲人信息
     *
     * @param qiuUserInfo 存储情侣的亲人信息
     * @return 结果
     */
    @Override
    public int updateSysUserInfo(QiuUserInfo qiuUserInfo)
    {
        qiuUserInfo.setUpdateTime(DateUtils.getNowDate());
        return qiuUserInfoMapper.updateSysUserInfo(qiuUserInfo);
    }

    /**
     * 批量删除存储情侣的亲人信息
     *
     * @param ids 需要删除的存储情侣的亲人信息主键
     * @return 结果
     */
    @Override
    public int deleteSysUserInfoByIds(Long[] ids)
    {
        return qiuUserInfoMapper.deleteSysUserInfoByIds(ids);
    }

    /**
     * 删除存储情侣的亲人信息信息
     *
     * @param id 存储情侣的亲人信息主键
     * @return 结果
     */
    @Override
    public int deleteSysUserInfoById(Long id)
    {
        return qiuUserInfoMapper.deleteSysUserInfoById(id);
    }
}
